package com.study.wechatboot.autoreply.controller;

import com.study.wechatboot.autoreply.pojo.recvmsg.RecvMsgJson;
import com.study.wechatboot.autoreply.service.impl.AutoReplyServiceImpl;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wechatboot")
public class AutoReplyController {

    private final AutoReplyServiceImpl autoReplyServiceImpl;

    public AutoReplyController(AutoReplyServiceImpl autoReplyServiceImpl) {
        this.autoReplyServiceImpl = autoReplyServiceImpl;
    }

    @PostMapping("/autoreply")
    public String parseJson(@RequestBody RecvMsgJson recvMsgJson) {
        autoReplyServiceImpl.autoReply(recvMsgJson);
        return "已进行自动回复";
    }
}
